#include "main.h"


int main(int argc, char *argv[])
{
    int      dev_id;
    int      dev_handle;


	system("sudo hciconfig hci0 reset");
	sleep(1);

	if (argc != 2)
	{
		printf("%s <device_address>\n", argv[0]);
		return 1;
	}

	char  *target_addr = argv[1];

    dev_id = hci_get_route(NULL);

	dev_handle = start_lescan(dev_id);


    print_advertising_devices(dev_handle, 0, target_addr);


	dev_connect(target_addr);

    hci_close_dev(dev_handle);

    return 0;
}


